const {defineConfig} = require('@vue/cli-service')
module.exports = defineConfig({
    transpileDependencies: true,
    configureWebpack: {
        resolve: {
            extensions: ['.ts', '.tsx']
        }
    },
    chainWebpack: config => {
        config.module.rule("ts")
            .test(/\.tsx?$/)
            .use("babel-loader")
            .loader("babel-loader")
            .end()
            .use("ts-loader")
            .loader("ts-loader")
            .options({
                    //https://github.com/TypeStrong/ts-loader
                    //TS2307: Cannot find module '!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js' or its corresponding type declarations.
                    appendTsSuffixTo: [/\.vue$/],
                    transpileOnly: false,
                    happyPackMode: false
                }
            )
            .end()



    }
})
